<?php
/**
 * demand_summary
 */
class Summary {
	static function add($data){
		return Db::get(__CLASS__)->insert($data)->exec()
				? Db::get(__CLASS__)->insertId()
				: false;
	}

	static function get($id){
		return Db::get(__CLASS__)->select()->where(array('id'=>$id))->getOne();
	}

	static function getList($where=null, $s=0, $l=0){
		return Db::get(__CLASS__)->select()->where($where)->limit($s, $l)->order('addtime DESC')->getAll();
	}

	static function update($id, $data){
		return Db::get(__CLASS__)->update($data)->where(array('id'=>$id))->exec();
	}
	
}
?>
